package com.todod.base.module.infra.api.baseofficialletter;

import com.todod.base.framework.common.pojo.CommonResult;
import com.todod.base.module.infra.enums.ApiConstants;
import com.todod.base.module.infra.vo.baseofficialletter.BaseOfficialLetterApiReqVO;
import com.todod.base.module.infra.vo.baseofficialletter.FileRespVO;
import com.todod.base.module.infra.vo.baseofficialletter.UserRespVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = ApiConstants.NAME) // TODO ：fallbackFactory =
@Tag(name = "RPC 服务 - 公函传阅", description = "公函传阅")
public interface BaseOfficialLetterApi {

    String PREFIX = ApiConstants.PREFIX + "/baseOfficialLetter";

    @GetMapping(PREFIX + "/bpmStatus")
    @Operation(summary = "工作流状态")
    @Parameters({
            @Parameter(name = "id", description = "订单id", example = "1", required = true),
            @Parameter(name = "bpmStatus", description = "工作流状态", example = "3", required = true)
    })
    void setStatus(@RequestParam("id") Long id, @RequestParam("status") Integer bpmStatus);

    @GetMapping(PREFIX + "/get")
    @Operation(summary = "通过公函 ID 查询公函管理信息")
    @Parameter(name = "id", description = "公函 ID", example = "1", required = true)
    CommonResult<BaseOfficialLetterApiReqVO> getBaseOfficialLetter(@RequestParam("id") Long id);

    @GetMapping(PREFIX + "/getLetterUserList")
    @Operation(summary = "通过公函 ID 获取公函管理-接收人员列表信息")
    @Parameter(name = "id", description = "公函 ID", example = "1", required = true)
    CommonResult<List<UserRespVO>> getLetterUserList(@RequestParam("id") Long id);

    @GetMapping(PREFIX + "/getLetterFileList")
    @Operation(summary = "通过公函 ID 获取公函管理-接收人员列表信息")
    @Parameter(name = "id", description = "公函 ID", example = "1", required = true)
    CommonResult<List<FileRespVO>> getLetterFileList(@RequestParam("id") Long id);
}
